home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / msk312.zip / ROLM.SCR < prev    next >
Text File  |  1992-09-24  |  3KB  |  92 lines

  1. ; FILE ROLM.SCR
  2. ;
  3. ; To be used with MS-DOS Kermit 3.11 or later.
  4. ;
  5. ; An MS-DOS Kermit script program for dialing from a ROLMphone DCM
  6. ; (Data Communication Module).
  7. ;
  8. ; Stored in Kermit Distribution as MSIROLM.SCR; rename to ROLM.SCR if
  9. ; necessary so the DIAL macro can find it.  Place this file in your current
  10. ; directory, or any directory in your DOS PATH.
  11. ;
  12. ; Expects variable \%1 to contain the phone number or data group name.  This
  13. ; is done by the DIAL macro defined in MSKERMIT.INI.  To make the DIAL macro
  14. ; use this file instead of HAYES.SCR, add the following line to your
  15. ; AUTOEXEC.BAT file:
  16. ;
  17. ;   SET MODEM=ROLM
  18. ;
  19. ; If you lack the DIAL macro definition, use this simple substitute:
  20. ;
  21. ;   DEFINE DIAL TAKE ROLM.SCR
  22. ;
  23. ; To use, just type "DIAL nnnnnnn" at the MS-Kermit> prompt, where "nnnnnnn"
  24. ; is the desired phone number or Rolm data group name.
  25. ;
  26. ; Sets SUCCESS flag if dialing succeeds, sets FAILURE flag 
  27. ; if it fails, for use with IF SUCCESS, IF FAILURE, \v(status).
  28. ;
  29. ; Author: Christine M. Gianone, September 1991.
  30. ; Revised September 1992.
  31.  
  32. ; Fatal error macro.
  33. ;
  34. def errfail if not def \%1 def \%1 Failed - try again later.,-
  35.   echo \%1, hangup, goto fail
  36.  
  37. ; Macro to check error messages.
  38. ;
  39. def chkmsg reinput 0 \%1, if success errfail
  40.  
  41. if < VERSION 311 errfail {MS-DOS Kermit 3.11 or later required.}
  42. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE
  43. set input echo on               ; Let's watch what happens
  44. clear                ; Clear out old stuff from INPUT buffer
  45. set count 3            ; Try up to 3 times to get Rolm prompt
  46.  
  47. :LOOP
  48. output \13                    ; Send carriage return
  49. input 3 MODIFY\63\13\10         ; ROLMphone says "CALL, DISPLAY OR MODIFY?"
  50. if success goto dial        ; Got it.
  51. if count goto loop        ; Didn't get it, try again.
  52.  
  53. echo ROLMphone not responding on port \v(port) at speed=\v(speed).
  54. errfail {Please check your connection and try again.}
  55.  
  56. :DIAL
  57. pause 1                ; Wait a second
  58. output CALL \%1\13              ; Dial the number or datagroup name
  59. set count 12            ; Try up to 12 times to read a known response
  60.  
  61. :GETMSG
  62. input 40 \13            ; Look for a carriage return.
  63. if fail errfail {No response to CALL command}
  64. reinput 0 CALL COMPLETE        ; The response we wanted.
  65. if success goto gotit
  66. chkmsg {NOT A DATALINE}        ; Check for error messages.
  67. chkmsg {FAILED}            ; This lets us fail right away, rather
  68. chkmsg {BUSY}            ; than waiting forever for CALL COMPLETE
  69. chkmsg {LACKS PERMISSION}    ; not to show up...
  70. chkmsg {DOES NOT ANSWER}
  71. chkmsg {INVALID GROUP NAME}
  72. chkmsg {INVALID DATA LINE NUMBER}
  73. chkmsg {ABANDONED}
  74. reinput 0 NOT AVAILABLE        ; This one needs a hint
  75. if fail goto again
  76. echo Failed - Most likely cause: \v(speed) bps can't be used with \%1.
  77. errfail {Please change your speed and try again.}
  78. :AGAIN
  79. if count goto getmsg        ; None of these, wait for another message.
  80. errfail {Sorry - I don't understand these reponses.} ; Too many tries.
  81.  
  82. :GOTIT
  83. echo \7                ; Succeeded, beep
  84. define errfail            ; Erase ERRFAIL definition
  85. define chkmsg            ; CHKMSG definition too
  86. end 0                ; Finished, return success code.
  87.  
  88. :FAIL                ; Dialing failed.
  89. define errfail            ; Erase ERRFAIL definition
  90. define chkmsg            ; CHKMSG definition too
  91. end 1                ; Return failure code.
  92.